<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>注册网易免费邮箱 - 中国第一大电子邮件服务商</title>
    <link rel="shortcut icon" href="statics/images/favicon.ico">
    <link rel="stylesheet" type="text/css" href="statics/css/c.css">
</head>
<body>
      <header class="header">
         <div class="bg"></div>

         <div class="ag">
            <a href="#">了解更多|</a>
            <a href="#">反馈意见</a>
         </div>
      </header>

      <section class="content">
             <header class="content-tit">
              <h1>欢迎注册无限容量的网易邮箱！邮件地址可以登录使用其他网易旗下产品。</h1>
             </header>
             <div class="mainBody-wrapper">

             <div class="mainBody">
              <div class="regTabs">
              <ul>
                  <li><a class="activer" href="#" style="font-weight: bold; color:#fff;">注册字母邮箱</a></li>
                  <li><a href="#">注册手机号码邮箱</a></li>
                  <li><a href="#">注册VIP邮箱</a></li>
              </ul>
              </div>
               <div class="regForm">
                <dl class="regForm-item">
                    <dt class="regForm-title">
                      <span class="txt-impt">*</span>
                      邮件地址
                    </dt>
                    <dd class="regForm-ct">
                     <input type="text" class="ipt">
                     <strong style="">@</strong>
                     <select>
                      <option selected="selected">163.com</option>

                     </select>
                     <div class="tip">6~18个字符，可使用字母、数字、下划线，需以字母开头
                            </div>
                      </dd>
                </dl>
                <dl class="regForm-item">
                    <dt class="regForm-title">
                         <span class="txt-impt">*</span>
                         密码   
                    </dt>
                    <dd class="regForm-ct">
                        <input type="text" class="ipt" style="width: 322px;">
                         <div class="tip"><span>6~16个字符，区分大小写</span></div>
                    </dd>
                </dl>
                <dl class="regForm-item">
                    <dt class="regForm-title">
                         <span class="txt-impt">*</span>
                         确认密码  
                    </dt>
                    <dd class="regForm-ct">
                        <input type="text" class="ipt" style="width: 322px;">
                         <div class="tip"><span>请再次填写密码</span></div>
                    </dd>
                </dl>
                <dl class="regForm-item">
                    <dt class="regForm-title">
                         <span class="txt-impt">*</span>
                         手机号码   
                    </dt>
                    <dd class="regForm-ct">
                    <input id="phone" type="text" class="ipt" style="width:322px; font-size:14px; font-weight: bold; padding-left: 40px; " value="+86" >


                      <div class="itl" style="width:35px; height:27px; line-height:27px;">
                         <div class="flag flag-CN">
                           <em>&nbsp;</em>
                      
                      </div>
                    
                      </div>      
                        <div class="tips">
                           <span>忘记密码时，可以通过手机号码快速找回密码</span>
                            </div>
                                      
                    <div class="itlSelect" style="display:none">

                            <a href="#" class="flag-CN"><em></em>中国 +86</a>
                            <a href="#" class="flag-DZ"><em></em>阿尔及利亚(People's Democratic Republic of Algeria) +213</a>
                            <a href="#" class="flag-AF"><em></em>阿富汗(Republic of Afghanistan) +93</a>
                            <a href="#" class="flag-AR"><em></em>阿根廷(Argentina) +54</a>
                            <a href="#" class="flag-AE"><em></em>阿拉伯联合大公国(The United Arab Emirates) +971</a>
                            <a href="#" class="flag-AW"><em></em>阿曼(Sultanate of Oman) +968</a>
                            <a href="#" class="flag-OM"><em></em>阿塞拜疆(Azərbaycan) +994</a>
                       </div>
                       
                       
                   
               
                    </dd>
                    </dl>

                    <dl class="regForm-item">
                    <dt class="regForm-title">
                         <span class="txt-impt">*</span>
                        验证码
                    </dt>
                    <dd class="regForm-ct">
                        <input type="text" class="ipt" style="position:relative;bottom:30px;">
                        <img src="statics/images/call.jpg" alt=""
                        >
                        <a href="" style="position:relative; text-decoration:blink;font-size: 10px; top:15px;right:110px;">看不清？换张图</a>
                         <div class="tip"><span style="position:relative;bottom:20px;">请填写图片中的字符，不区分大小写</span>
                         </div>
                         <div class="bnt">
                            <a href="javascript:void(0);" class="bnt" hidefocus="true" onclick="_Global.main.mainAcode();">
                             <strong >免费获取验证码</strong></a>
                            </a>
                         </div>
                    </dd>
                </dl>
              
             </div>
          </div>
          
             <div class="mainBody-side">
                <div class="regExt">
                  <img src="statics/images/reg_master.gif">
                </div>
              </div>

            </div>
        </section>
         


      <script type="text/javascript">

         function itlSelect() {
               var links = document.querySelectorAll('.itlSelect');
               
            
             for(i=0;i<links.length;i++){
              links[i].addEventListener('click',function(e){
               var a = e.target;
              
              var txt = a.innerText;
              var cls = a.className;
              var area = txt.substr(txt.indexOf("+"), txt.length -  txt.indexOf("+"));

              document.querySelector('#phone').setAttribute('value',area);

              var p = document.querySelector('.flag');
              p.className=" flag "+cls;


       })  
   }
 }



function switchFlag(){
  var flag = document.querySelector('.itl');
  flag.addEventListener('click',function(e){

    var d = e.target;
    var panel = document.querySelector('.itlSelect');
    panel.style.display==='none'? panel.style.display='block':panel.style.display = 'none'

    

  });
  console.log(flag);
}

  function switchTab(){

    var tabs = document.querySelectorAll('.regTabs ul li a');
    
    var ul=document.querySelector(".regTabs ul");

    for(i=0;i<tabs.length;i++){
      tabs[i].index=i;
       tabs[i].addEventListener('click',function(e){

         var item = e.target;

        console.log(item.index);

        ul.style.background= "url(statics/images/tab.jpg) 0 -"+item.index*54+"px";
        


        for(var j=0;j<tabs.length;j++){
          tabs[j].style.color ='#000';
          tabs[j].style.fontWeight = "";

        }
        item.style.color = '#fff';
        item.style.fontWeight = "bold";
    });
   }
  }


   itlSelect();
   switchFlag();
   switchTab();


   </script>
	
</body>
</html> 